package com.wuba.rxjavademo.tzx.filter;

import com.wuba.rxjavademo.tzx.common.Base;

import rx.Observable;

/**
 * Created by tanzhenxing
 * Date: 2016/6/27.
 * Description:
 * repeat()重复一定的次数
 */
public class RxRepeat extends Base {
    public static void main(String[] args) {
        RxRepeat rxRepeat = new RxRepeat();
        rxRepeat.run();
    }

    @Override
    public void run() {
        getObservable().subscribe(Base::print);
    }

    @Override
    public Observable<Integer> getObservable() {
        return Observable.from(items)
                .take(3)
                .repeat(3);
    }
}
